package util;

import java.sql.Connection;
import java.sql.DriverManager;

public class DBUtil {
    public static Connection getConnection() throws Exception {
        Connection conn=null;
        try {
            Class.forName("com.mysql.jdbc.Driver");
            conn= DriverManager.getConnection(
                    "jdbc:mysql://localhost:3306/jsd2006db?userUnicode=true&characterEncoding=utf8",
                    "root","");
        } catch (Exception e) {
            e.printStackTrace();
            throw e;

        }
        return conn;
    }

    public static void main(String[] args) throws Exception {
        System.out.println(getConnection());
    }
}
